export const px2rem = (value) => {
  const v = parseFloat(value);
  if (v < 3) return v + 'px';

  const REM = parseFloat(getComputedStyle(document.documentElement).fontSize);
  return (v / REM).toFixed(3) + 'rem';
};

export const rem2px = (value) => {
  const REM = parseFloat(getComputedStyle(document.documentElement).fontSize);
  return parseFloat(value) * REM + 'px';
};
